package testes;

import java.awt.EventQueue;
import java.net.InetAddress;
import servidor.rede.Conexao;
import cliente.rede.ConexaoCliente;
import gui.telaCliente;
import gui.telaServidor;

public class TesteTelasCleanV2 {
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public synchronized void run() {
				try {
					
					//inicializa tela servidor
					new telaServidor();
					telaServidor.frmServidor.setVisible(true);
					//inicializa servidor
					synchronized(this)  {
						Conexao conexaoservidor = new Conexao(5002);
					}
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
			
		});
		EventQueue.invokeLater(new Runnable() {
			public synchronized void run() {
				try {
					//inicializa tela cliente
					new telaCliente();
					telaCliente.frmCliente.setVisible(true);
					InetAddress ip = InetAddress.getByName("localhost");
					//inicializa cliente
					synchronized(this)  {
						ConexaoCliente conexaocliente = new ConexaoCliente(ip, 5002);
					}
					
					
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}
}